From: Nick Roberts Date: Wed, 28 Apr 2004 18:15:12 +0000 (+0000) Subject: (gud-common-init): Throw an error if program is X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~22860 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a3e79591d9d1e55f959f39d9f2fbf3c924940a64;p=emacs.git (gud-common-init): Throw an error if program is already running under gdb. --- diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index bdf8c93f900..9cb3ae26c3b 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2384,8 +2384,10 @@ comint mode, which see." (if (file-name-directory file-subst) (expand-file-name file-subst) file-subst))) - (filepart (and file-word (concat "-" (file-name-nondirectory file))))) + (filepart (and file-word (concat "-" (file-name-nondirectory file)))) + (existing-buffer (get-buffer (concat "*gud" filepart "*")))) (pop-to-buffer (concat "*gud" filepart "*")) + (if existing-buffer (error "This program is already running under gdb")) ;; Set the dir, in case the buffer already existed with a different dir. (setq default-directory dir) ;; Set default-directory to the file's directory.